package com.cogent.dao.facade;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.cogent.dao.domain.Pagination;
import com.cogent.dao.domain.ParamDomain;
import com.cogent.dao.domain.QueryParamDomain;
import com.cogent.dao.domain.TableInfoDomain;
import com.cogent.dao.sql.ISqlBuilder;

public interface BussinessDaoFacade {
	
public String save(String tableName, HashMap valMap);
	
	public String batchSave(String tableName, List valList);
	
	public String update(String tableName, HashMap valMap);
	
	public String update(String tableName, HashMap valMap, String idkey);
	
	public String saveOrUpdate(String tableName, HashMap valMap);
	
	public String delete(String tableName, List<QueryParamDomain> valList);
	
	public String executeSql(String sql);
	
	public String executeSql(String sql, List<QueryParamDomain> paramList);
	
	public HashMap getByID(String tableName,  List<QueryParamDomain> valList);
	
	public HashMap getOneRow(String sql);
	
	public HashMap getOneRow(String sql, List<QueryParamDomain> valList);
	
	public HashMap getOneRowByTable(String tableName,  List<QueryParamDomain> valList);
	
	public List query(String tableName,  List<QueryParamDomain> valList);
	
	public List query(String sql,  List<QueryParamDomain> valList, String groupBy);
	
	public List queryWithPostfix(String tableName,  List<QueryParamDomain> valList, String postfix);
	
	public List queryWihtParam(String sql, List<QueryParamDomain> paramList);
	
	public List queryLimit(String tableName,  List<QueryParamDomain> valList, int limit);
	
	public List queryLimit(String tableName,  List<QueryParamDomain> valList, String order, int limit);
	
	public List queryLimitBySql(String sql,  List<QueryParamDomain> valList, int limit);
	
	public List queryLimitBySql(String sql,  List<QueryParamDomain> valList, String order, int limit);
	
	public Pagination queryPaged(String tableName, List<QueryParamDomain> valList, String order, int page, int pageSize);
	
	public List queryWithPrefix(String prefixSql, List<QueryParamDomain> valList);
	
	public Pagination queryWithPrefixPaged(String prefixSql, List<QueryParamDomain> valList, String order, int page, int pageSize);
	
	public List query(String sql);
	
	public Pagination queryPaged(String sql, String order, int page, int pageSize);
	
	public TableInfoDomain getColumnInfo(String tableName);
	
	public Map getDBFieldMappedType();
	
	public void beginTran();
	
	public void commitTran();
	
	public void rollbackTran();
	
	public void createConn();
	
	public void closeConn();
	
	public String getDataSourceUserName();
	
	public String getTableName(String sql);
	
	public ISqlBuilder getORMSqlBuilder();
	
	public List queryWhithParam(String sql,  List<ParamDomain> paramlist, String groupBy);
}
